package com.sqx.modules.task.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.task.entity.HelpOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;

/**
 * @author fang
 * @date 2021/1/6
 */
@Mapper
public interface HelpOrderDao extends BaseMapper<HelpOrder> {

    IPage<HelpOrder> selectNewHelpOrderList(Page<HelpOrder> page, Long gameId, String latitude, String longitude, Integer sort, Integer taskType, Long classifyId, Long userId);

    IPage<HelpOrder> selectHelpOrderByClassifyList(Page<HelpOrder> page,@Param("classifyId") Long classifyId,Long gameId);

    IPage<HelpOrder> selectHelpOrderByContentList(Page<HelpOrder> page,@Param("content") String content,Long gameId);

    IPage<HelpOrder> selectStatusHelpOrder(Page<HelpOrder> page,@Param("phone") String phone,@Param("content") String content,@Param("status") Integer status,Long gameId,Integer taskType);

    Integer countHelpOrderByCreateTime(@Param("time") String time,@Param("flag") Integer flag);

    Double sumPrice(@Param("time") String time,@Param("flag") Integer flag);


    IPage<HashMap<String, Object>> getCompanyOrder(@Param("pages") IPage<HashMap<String, Object>> pages, @Param("status") Integer status, @Param("userId") Long userId, @Param("companyId") Long companyId, Long userIds);

    Integer selectHelpOrderCountByStatusAndTime(@Param("time")String time,@Param("flag") Integer flag,@Param("state") Integer state);

    Double selectHelpOrderMoneyByStatusAndTime(@Param("time")String time,@Param("flag") Integer flag,@Param("payWay") Integer payWay);

    IPage<HelpOrder> selectNowDayOrders(@Param("pages") Page<HelpOrder> pages, @Param("userId") Long userId);

    IPage<HelpOrder> selectCreateHelpOrder(@Param("pages") Page<HelpOrder> pages, @Param("status") Integer status, @Param("userId") Long userId, @Param("gameId") Long gameId);

    Integer selectHelpTakeCountByStatusAndTime(@Param("time")String time,@Param("flag") Integer flag,
                                                @Param("state") Integer state,@Param("userId") Long userId);

    Double selectHelpTakeMoneyByStatusAndTime(@Param("time")String time,@Param("flag") Integer flag,
                                               @Param("userId") Long userId);
}
